<template>
  <div class="common-layout">
    <el-container>
      <!-- 侧边栏 -->
      <el-aside :width="isFole ? '60px' : '200px'">
        <AsideTab :isFole="isFole" />
      </el-aside>
      <el-container>
        <!-- 头部导航区域 -->
        <el-header>
          <Header @isWidth="asideWidthFn" />
        </el-header>
        <!-- 中间主体内容区域 -->
        <el-main>
          <RouterView />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import AsideTab from './c-cpns/AsideTab/index.vue';
import Header from './c-cpns/Header/index.vue';

const isFole = ref(false);

const asideWidthFn = (payload: boolean) => {
  isFole.value = payload;
};
</script>

<style lang="less" scoped>
.common-layout {
  height: 100%;
  .el-container {
    height: 100%;
  }

  :deep(.el-aside) {
    background: -webkit-linear-gradient(bottom, #3d6df8, #5b8cff);
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 250ms ease-in;
  }

  :deep(.el-header) {
    background: -webkit-linear-gradient(left, #3d6df8, #5b8cff);
  }
}
</style>
